<style>
    .send-editor .msg_sender{margin: 10px;}
</style>
<div class="padding">
    <div class="gray tips-title pt20">可创建最多3个一级菜单，每个一级菜单下可创建最多5个二级菜单。</div>
    <div class="self-menu-wrap">
        <div class="wrap-inner clearfix">
            <div class="left-wrap">
                <div class="menu-wrap">
                    <div class="menu-setting">
                        <div class="menu-title-area">
                            <div class="menu-title-wrap">
                                <span>菜单管理</span>
                                <div class="opt-wrap">
                                    <a title="添加" href="javascript:;" class="img-btn add" ng-show="!sorting"
                                       ui-dialog="添加一级菜单"
                                       ui-dialog-data="getMenuData(null,null)"
                                       ui-dialog-before-show="checkOneMenu($data)"
                                       ui-dialog-ok="addMenu($data)"
                                       ui-dialog-cache="false"
                                       ui-dialog-url="business_modules/custom_menu/ngviews/dialog_content.html">
                                        添加
                                    </a>

                                    <a title="排序" href="javascript:;" id="sortBtn" class="img-btn sort" ng-click="sortingMenu()" ng-show="!sorting">排序</a>
                                    <a title="完成" href="javascript:;" id="okBtn" class="color-btn ok show"  ng-show="sorting" ng-click="sortedMenu()">完成</a>
                                    <a title="取消" href="javascript:;" id="cancelBtn" class="color-btn cancel show"  ng-show="sorting" ng-click="sorting=false">取消</a>
                                </div>
                            </div>
                        </div>


                        <div class="menu-content-area">
                            <ul drag-sort="sorting" drag-selector=".drag-menu-one" drag-selector-exclude=".drag-menu-two">
                                <li ng-repeat="oneMenu in menuList" class="drag-menu-one" data-id="{{oneMenu.id}}">
                                    <a href="javascript:;" style="padding-left: 12px"  ng-class="{'selected':oneMenu.id==currMenu.id}" ng-click="changeCurrMenu(oneMenu)">
                                        <span class="text">{{oneMenu.name}}</span>
                                        <span class="img-btn plus" ng-show="!sorting"
                                              ui-dialog="添加二级菜单"
                                              ui-dialog-data="getMenuData($index,null)"
                                              ui-dialog-before-show="checkTwoMenu($data)"
                                              ui-dialog-ok="addMenu($data)"
                                              ui-dialog-cache="false"
                                              ui-dialog-url="business_modules/custom_menu/ngviews/dialog_content.html"></span>
                                        <span class="img-btn sort-icon show" ng-show="sorting"></span>
                                    </a>
                                    <ul drag-sort="sorting" drag-selector=".drag-menu-two">
                                        <li ng-repeat="twoMenu in oneMenu.items" class="drag-menu-two" data-id="{{twoMenu.id}}" >
                                            <a href="javascript:;" style="padding-left: 24px" ng-class="{'selected':twoMenu.id==currMenu.id}" ng-click="changeCurrMenu(twoMenu)">
                                                <span class="text">{{twoMenu.name}}</span>
                                                <span class="img-btn sort-icon" ng-show="sorting"></span>
                                            </a>
                                        </li>
                                    </ul>
                                </li>
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
            <div class="right-wrap">
                <div class="menu-content-wrap">
                    <div class="opt-title-wrap" ng-show="!!currMenu">
                        <span>{{!currMenu.parent_id?'一':'二'}}级菜单 : {{currMenu.name}}</span>
                        <a href="javascript:;" ng-click="delMenu()">删除</a>
                        <a href="javascript:;"
                           ui-dialog="修改{{!currMenu.parent_id?'一':'二'}}级菜单"
                           ui-dialog-data="renameData()"
                           ui-dialog-ok="renameMenu($data)"
                           ui-dialog-cache="false"
                           ui-dialog-url="business_modules/custom_menu/ngviews/dialog_content.html">重命名</a>
                    </div>
                    <div class="opt-content">
                        <div class="gray align-c">
                            <p ng-show="!currMenu" style="padding: 80px 0 60px;text-align: center;">你可以点击左侧菜单或添加一个新菜单，然后设置菜单响应动作</p>
                            <div class="actions icon-area" ng-show="!!currMenu&&!currMenu.type&&!alterMenu.alter">

                                <p>{{currMenuOpt.title}}</p>

                                <a href="javascript:;" style="display: inline-block;" ng-show="currMenu.level==0"
                                   ui-dialog="添加二级菜单"
                                   ui-dialog-data="getMenuData(currMenu.sort,null)"
                                   ui-dialog-before-show="checkTwoMenu($data)"
                                   ui-dialog-ok="addMenu($data)"
                                   ui-dialog-cache="false"
                                   ui-dialog-url="business_modules/custom_menu/ngviews/dialog_content.html">
                                    <i class="icon-action add"></i>
                                    <strong>添加二级菜单</strong>
                                </a>
                                <a href="javascript:;" ng-show="!currMenuOpt.OneHasTwo" ng-click="triggerSendMessage()">
                                    <i class="icon-action send"></i>
                                    <strong>发送信息</strong>
                                </a>
                                <a href="javascript:;" ng-show="!currMenuOpt.OneHasTwo" ng-click="alterMenu.alter=true;alterMenu.type='7'">
                                    <i class="icon-action url"></i>
                                    <strong>跳转到网页</strong>
                                </a>
                                <a href="javascript:;" ng-show="!currMenuOpt.OneHasTwo">
                                    <i class="icon-action url"></i>
                                    <strong>连接功能模块</strong>
                                </a>
                            </div>
                            <div class="send-wrap" ng-if="alterMenu.alter&&alterMenu.type!=7">
                                <p>订阅者点击该子菜单会收到以下消息，<a class="resetAction" href="javascript:;" followmenu ng-model="resetObj">重设动作</a></p>
                                <div id="send-editor" class="send-editor">
                                    <div send-tab></div>
                                </div>
                            </div>
                            <div class="url-wrap" ng-show="alterMenu.alter&&alterMenu.type==7">
                                <div class="gray menu1" style="padding:10px;text-align: left;">
                                    <div class="icon-area clearfix" style="display: block;">
                                        <p>订阅者点击该菜单后会链接功能模块，<a style="color:#459ae9;" followmenu ng-model="resetObj">重设动作</a></p>
                                        <p style="position: relative;">
                                            <span style="float: left;">外链接URL</span>
                                            <input type="url" ng-model="alterMenu.content">
                                            <span class="x-icon x-icon-fix" style="padding: 4px 8px; left: 50%;" ng-click="alterMenu.content=''">×</span>
                                        </p>
                                    </div>
                                    <div style="position: relative; margin-top: 20px;">
                                        <div class="menu-tab-content">
                                            <div class="tab-content">
                                                <ul class="tab_navs clearfix">
                                                    <li class="tab_nav" style="cursor: pointer;">
                                                        <a href="javascript:void(0);">&nbsp;<span class="title">微信基础设置</span></a>
                                                    </li>
                                                    <li class="tab_nav" style="cursor: default;">
                                                        <a href="javascript:void(0);">&nbsp;<span class="title">基础插件</span></a>
                                                    </li>
                                                    <li class="tab_nav" style="cursor: pointer;">
                                                        <a href="javascript:void(0);">&nbsp;<span class="title">营销推广</span></a>
                                                    </li>
                                                    <li class="tab_nav selected" style="cursor: pointer;">
                                                        <a href="javascript:void(0);">&nbsp;<span class="title">地产云客应用</span></a>
                                                    </li>
                                                </ul>
                                                <div class="tab_cont_cover" style="display: block; position: inherit;">
                                                    <div class="tab_cont_inner" style="padding: 10px 0px;">
                                                        <ul class="menu-tab-ul">
                                                            <li><span>微楼书</span><span><a>详细</a></span><span><a>选中</a></span></li>
                                                            <li><span>移动销售</span><span><a>详细</a></span><span><a>选中</a></span></li>
                                                            <li><span>微楼书</span><span><a>详细</a></span><span><a>选中</a></span></li>
                                                            <li><span>微楼书</span><span><a>详细</a></span><span><a>选中</a></span></li>
                                                            <li><span>微楼书</span><span><a>详细</a></span><span><a>选中</a></span></li>
                                                            <li><span>微楼书</span><span><a>详细</a></span><span><a>选中</a></span></li>

                                                        </ul>


                                                    </div>
                                                </div>

                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="view-wrap" ng-show="currMenu.type&&!alterMenu.alter">
                                <div style="padding: 64px 86px; text-align: left;">
                                    <p style="color:#222; padding-bottom: 20px;" class="tips">
                                        {{currMenu.type==7?'订阅者点击该子菜单会跳到以下链接':''}}
                                        {{currMenu.type<4?'订阅者点击该子菜单会收到以下消息':''}}
                                    </p>
                                    <div class="view-area">
                                        <div class="view-box" ng-show="currMenu.type==1 || currMenu.type==7" style="border: 1px solid #e7e7eb; padding: 4px 10px;word-wrap: break-word;word-break: break-all;position: relative;">
                                            {{currMenu.content}}
                                        </div>
                                        <div class="view-box" ng-show="currMenu.type==2"  style="border: 1px solid #e7e7eb; padding: 4px 10px;word-wrap: break-word;word-break: break-all;position: relative;">
                                            <div class="clearfix" style="position:relative;">
                                                <div class="appmsg pull-left w297" ng-if="currMenuOpt.content.articles.length === 1">
                                                    <div class="appmsg_content" ng-init="article = currMenuOpt.content.articles[0]">
                                                        <h4 class="appmsg_title">
                                                            <a href="javascript:;" ng-cloak>{{article.title}}</a>
                                                        </h4>
                                                        <div class="appmsg_info">
                                                            <em class="appmsg_date" ng-cloak>{{currMenuOpt.content.modified_on * 1000|date: 'yyyy-MM-dd hh:mm:ss'}}</em>
                                                        </div>
                                                        <div class="appmsg_thumb_wrp">
                                                            <img ng-src="{{article.cover_url}}" alt="" class="appmsg_thumb">
                                                        </div>
                                                        <p class="appmsg_desc" ng-cloak>{{article.summary}}</p>
                                                    </div>
                                                </div>
                                                <div class="appmsg multi w297" ng-if="currMenuOpt.content.articles.length > 1">
                                                    <div class="appmsg_content">
                                                        <div class="appmsg_info">
                                                            <em class="appmsg_date" ng-cloak>{{currMenuOpt.content.modified_on * 1000|date: 'yyyy-MM-dd hh:mm:ss'}}</em>
                                                        </div>
                                                        <div class="cover_appmsg_item" ng-init="article = currMenuOpt.content.articles[0];">
                                                            <h4 class="appmsg_title js_title">
                                                                <a href="javascript:;" ng-cloak>{{article.title}}</a>
                                                            </h4>
                                                            <div class="appmsg_thumb_wrp">
                                                                <img ng-src="{{article.cover_url}}" alt="" class="appmsg_thumb">
                                                            </div>
                                                        </div>
                                                        <div class="appmsg_item" ng-repeat="article in currMenuOpt.content.articles" ng-if="$index">
                                                            <img ng-src="{{article.cover_url}}" alt="" class="appmsg_thumb">
                                                            <h4 class="appmsg_title js_title">
                                                                <a href="javascript:;" ng-cloak>{{article.summary}}</a>
                                                            </h4>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="view-box" ng-show="currMenu.type==3" style="border: 1px solid #e7e7eb; padding: 4px 10px;word-wrap: break-word;word-break: break-all;position: relative;">
                                            <div class="media_list">
                                                <div class="appmsgSendedItem simple_audiomsg">
                                                    <a class="title_wrp" href="{{currMenuOpt.content.voice_url}}" target="_blank">
                                                        <span class="icon icon_lh" src=""></span>
                                                        <span class="title">{{currMenuOpt.content.name}}</span>
                                                    </a>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="view-box" ng-show="currMenu.type==4" style="border: 1px solid #e7e7eb; padding: 4px 10px;word-wrap: break-word;word-break: break-all;position: relative;">
                                            <img style="width:80px; height:80px; margin:6px 0;" ng-src="{{currMenuOpt.content.img_url}}">
                                            <a class="top-link" href="javascript:;" target="_blank">{{currMenuOpt.content.name}}</a>
                                        </div>
                                        <div class="view-box" ng-show="currMenu.type==5" style="border: 1px solid #e7e7eb; padding: 4px 10px;word-wrap: break-word;word-break: break-all;position: relative;">
                                            <div class="media_list">
                                                <div class="appmsgSendedItem simple_audiomsg">
                                                    <a class="title_wrp" href="{{currMenuOpt.content.video_url}}" target="_blank">
                                                        <span class="icon icon_lh" src=""></span>
                                                        <span class="title">{{currMenuOpt.content.name}}</span>
                                                    </a>
                                                </div>
                                            </div>
                                        </div>
                                        <div style="padding-top: 20px;">
                                            <a class="modify-btn" ng-click="alter()">修改</a>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="tips-footer" style="display: none;">
            <p class="weak_text">编辑中：点击下方“保存并发布”，才能更新到手机上 </p>
            <p class="warn" style="display: none;">待发布(还有13小时)</p>
            <p class="success" style="display: none;">菜单正在使用中</p>
        </div>
    </div>
    <div class="button-area align-c pt20">
        <!--            <button type="button" class="btn-pr ok-btn" id="save_btn">保存</button>-->
        <button type="button" class="btn-pr ok-btn" ng-click="publicMenu()">发布</button>
    </div>
</div>